package com.zzx.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.zzx.entity.TProductGxSubmit;
import com.zzx.service.TProductGxSubmitService;
import com.zzx.entity.ApiResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 产品工序提交记录 控制器
 *
 * @author zzx
 * @since 2025-07-24
 */

@Api(tags = "产品工序提交记录 模块管理")
@RestController
@RequestMapping("/tProductGxSubmit")
public class TProductGxSubmitController {

    @Resource
    private TProductGxSubmitService tProductGxSubmitService;

    @ApiOperation(value = "新增、编辑")
    @PostMapping("/add")
    public ApiResult add(@RequestBody TProductGxSubmit param) {
        tProductGxSubmitService.add(param);
        return ApiResult.ok();
    }

    @ApiOperation(value = "列表查询")
    @PostMapping("/selectBy")
    public ApiResult selectBy(@RequestBody TProductGxSubmit param) {
        return ApiResult.ok(tProductGxSubmitService.selectBy(param));
    }

    @ApiOperation("根据ID获取详情")
    @GetMapping("/{id}")
    public ApiResult getById(@PathVariable("id") String id) {
        return ApiResult.ok(tProductGxSubmitService.findById(id));
    }

    @ApiOperation(value = "删除")
    @PostMapping("/deleteById")
    public ApiResult deleteById(@RequestBody TProductGxSubmit param) {
        tProductGxSubmitService.deleteById(param);
        return ApiResult.ok();
    }
}
